package Book;

public class Bookshelf {
    private Book[] bookList = new Book[10];
    private int usedSize;

    public Bookshelf() {
        this.bookList[0] = new Book("三国演义","罗贯中",9.9,"小说");
        this.bookList[1] = new Book("西游记","吴承恩",19.9,"小说");
        this.bookList[2] = new Book("红楼梦","曹雪芹",29.9,"小说");
        this.usedSize = 3;

    }

    public Book[] getBookList() {

        return bookList;
    }

    public void setBook(Book book) {

        this.bookList[this.usedSize] = book;
        this.usedSize++;

    }
    public Book getBook(int pos) {
        return this.bookList[pos];
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
}
